package java6681.user;

import java.util.Scanner;

public class AddUser6681 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入用户名：");
        String name = sc.nextLine();
        System.out.print("请输入密码：");
        String pwdFirst = sc.nextLine();
        System.out.print("请再次输入密码：");
        String pwdSecond = sc.nextLine();
        System.out.print("请输入手机号：");
        String phone = sc.nextLine();
        if (Register6681.addUser6681(name,pwdFirst,pwdSecond,phone)){
            System.out.println("恭喜" + name + "注册成功");
            System.out.println();
            System.out.println("当前已注册用户："  + Register6681.getUserList());
        }else{
            System.out.println(Register6681.getErrMessage());
        }
       /* Register6681 register = new Register6681();
        User6681 user = new User6681();
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入用户名：");
        String name = sc.nextLine();
        if (register.checkName6681(name)) {
            user.setName(name);
        } else {
            System.out.println(register.getErrMessage());
        }
        System.out.print("请输入密码：");
        String pwdFirst = sc.nextLine();
        System.out.print("请再次输入密码：");
        String pwdSecond = sc.nextLine();

        if (register.checkPassword6681(pwdFirst, pwdSecond)) {
            user.setPassword(pwdFirst);
            user.setPassword(pwdSecond);
        } else {
            System.out.println(register.getErrMessage());
        }
        System.out.print("请输入手机号：");
        String phone = sc.nextLine();
        if (register.checkPhone6681(phone)) {
            user.setPhone(phone);
        } else {
            System.out.println(register.getErrMessage());
        }
        if (register.addUser6681(name, pwdFirst, pwdSecond, phone)) {
            System.out.println("恭喜" + name + "注册成功");
            System.out.println();
            System.out.println("当前已注册用户："  + user);
        } else {
            System.out.println(register.getErrMessage());
        }*/


    }
}
